DWPRINST ;PICASSO/JOLLIS - INSTALLATION;9/13/10;src/inst/KBBMPNST.m
;;3.0;9/13/10;1
;; $Id: DWPRINST.m 4 2010-10-24 17:30:25Z jollis $

 W #!!!,"Prefiniti 3.0 Setup",!,!
 W "NOTE: All inputs are case-sensitive. For instance,",!
 W "when the setup program asks for a (Y/n) response,",!
 W "typing ""y"" will count as ""no"".",!,!
 I $G(^DWPREF("SITENAME"),":::NOSITE")'=":::NOSITE" D
 .W "*** WARNING ***",!
 .W "RUNNING THIS PROGRAM WILL DESTROY ALL DATA ON THIS",!
 .W "PREFINITI INSTANCE.",!,!
 .W "DO YOU WISH TO CONTINUE? (Y/n) "
 .R YORN
 .I YORN'="Y" HALT
 ;; set up the instance name
 W !,"FRAME NUMBER? "
 R FRAM
 W !,"INSTANCE NUMBER? "
 R INUM
 W !,"INSTANCE TYPE? (D = DEVELOPMENT, T = TEST, P = PRODUCTION) "
 R ITYPE
 S ^DWPREF("SITENAME")="F"_FRAM_"I"_INUM_ITYPE
 W !,"EWD ROOT? "
 R ^DWPREF("EWDROOT")
 ;; initialize ORMS structures
 W !,"ORMS:  INITIALIZING DATA STRUCTURES",!
 S ^DWPREF("UIDMAX")=0
 K ^DWORMS
 K ^DWIND
 K ^DWHOOKS
 K ^DWCLAS
 K ^DWMODL
 K ^DWLCKS
 K ^DWPCMD
 S ^DWORSTAT("ADD")=0
 S ^DWORSTAT("REVISE")=0
 S ^DWORSTAT("APPEND")=0
 S ^DWORSTAT("READS")=0
 S ^DWORSTAT("READBYTES")=0
 S ^DWORSTAT("KEYBYTES")=0
 S ^DWORSTAT("PDBBYTES")=0
 S ^DWORSTAT("OIDBYTES")=0
 S ^DWORSTAT("HOOKSRUN")=0
 S ^DWPREF("FIRSTRUN")=1
 S ^DWPREF("TERMINAL")="DWTVT100"
 S ^DWPREF("COLORS","BACKGROUND","BLACK")=40
 S ^DWPREF("COLORS","BACKGROUND","RED")=41
 S ^DWPREF("COLORS","BACKGROUND","GREEN")=42
 S ^DWPREF("COLORS","BACKGROUND","YELLOW")=43
 S ^DWPREF("COLORS","BACKGROUND","BLUE")=44
 S ^DWPREF("COLORS","BACKGROUND","MAGENTA")=45
 S ^DWPREF("COLORS","BACKGROUND","CYAN")=46
 S ^DWPREF("COLORS","BACKGROUND","WHITE")=47
 S ^DWPREF("COLORS","FOREGROUND","BLACK")=30
 S ^DWPREF("COLORS","FOREGROUND","RED")=31
 S ^DWPREF("COLORS","FOREGROUND","GREEN")=32
 S ^DWPREF("COLORS","FOREGROUND","YELLOW")=33
 S ^DWPREF("COLORS","FOREGROUND","BLUE")=34
 S ^DWPREF("COLORS","FOREGROUND","MAGENTA")=35
 S ^DWPREF("COLORS","FOREGROUND","CYAN")=36
 S ^DWPREF("COLORS","FOREGROUND","WHITE")=37
 S ^DWPREF("TEXTATTR","CLEAR")=0
 S ^DWPREF("TEXTATTR","BOLD")=1
 S ^DWPREF("TEXTATTR","UNDERLINE")=4
 S ^DWPREF("TEXTATTR","BLINK")=5
 S ^DWPREF("TEXTATTR","REVERSE")=7
 S ^DWPREF("TEXTATTR","CONCEALED")=8
 S ^DWPREF("DEFAULTS","HDRFG")="WHITE"
 S ^DWPREF("DEFAULTS","HDRBG")="BLUE"
 S ^DWPREF("DEFAULTS","CMDFG")="WHITE"
 S ^DWPREF("DEFAULTS","CMDBG")="BLACK"
 S ^DWPREF("XPOS")=0
 S ^DWPREF("YPOS")=0
 S ^DWPREF("XPOS","P")=0
 S ^DWPREF("YPOS","P")=0
 S ^DWPREF("FG")="WHITE"
 S ^DWPREF("FG","P")="WHITE"
 S ^DWPREF("BG")="BLACK"
 S ^DWPREF("BG","P")="BLACK"
 S ^DWPCMD("CLASS CREATE")="D CREATCLS"
 S ^DWPCMD("CLASS UPDATE")="D UPDTCLS"
 S ^DWPCMD("CLASS INPUT")="D INPTCLS"
 S ^DWPCMD("DESCRIBE CLASS")="D DESCCLS"
 S ^DWPCMD("RECORD CREATE")="D CREATREC"
 S ^DWPCMD("RECORD UPDATE")="D UPDTREC"
 S ^DWPCMD("RECORD APPEND")="D APNDREC"
 S ^DWPCMD("RECORD VIEW")="D VIEWREC"
 S ^DWPCMD("SYSTEM SHELL")="D SYSSHELL"
 S ^DWPCMD("EDIT MODULE")="D EDITMOD"
 S ^DWPCMD("TERMINAL RESET")="D RESETSCR"
 S ^DWPCMD("SHOW MODULES")="D SHOMODS"
 S ^DWPCMD("SHOW ORMS STATISTICS")="D SHOOSTAT"
 S ^DWPCMD("SHOW HOOKS")="D SHOHOOKS"
 S ^DWPCMD("SHOW USERS")="D SHOUSERS"
 S ^DWPCMD("QUERY LOGS")="D QRYLOGS"
 S ^DWPCMD("FETCH RECORDSET")="D FETCHRS"
 S ^DWPCMD("LIST COMMANDS")="D LISTCMD"
 S ^DWPCMD("QUERY ORMS")="D QRYORMS"
 S ^DWPCMD("HELP")="D HELP"
 S ^DWPCMD("QUIT")="D SHELQUIT"

 ;; create the root node and set it
 S NEWRT=$$CREATE^DWORREC("","ROOTNODE","Prefiniti Root Node","ROOTNODE",0)
 D SETRTNOD^DWORREC(NEWRT)
 ;; create the ORMS class for the root node
 S RTNDCLSS=$$CREATE^DWORCLAS("ROOTNODE","")
 ;; create the ORMS class for ORMS classes
 S CLSSCLSS=$$CREATE^DWORCLAS("CLASDEFN","")
 W !,"ORMS:  THE ROOT NODE HAS BEEN CHANGED",!
 W "ORMS:  THE NEW ROOT NODE IS ",NEWRT,!
